//
//  Common.swift
//  News
//
//  Created by Mac on 2025/5/9.
//
import UIKit
import Foundation

let kScreenW = UIScreen.main.bounds.width
let kScreenH = UIScreen.main.bounds.height

//keyWindow
let keyWindow = UIApplication.shared.keyWindow

//判断是否iPhone
let kIsIphone = Bool(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.phone)

//判断是否iPhone X
let kIsIphoneX = Bool(kScreenW >= 375 && kScreenH >= 812.0 && kIsIphone)

//导航条高度
let kNavigationBarH = CGFloat(kIsIphoneX ? 88 : 64)

//状态栏高度
let kStatusBarH = CGFloat(kIsIphoneX ? 44 : 20)

// tabbar高度
let kTabBarH = CGFloat(kIsIphoneX ? (49 + 34) : 49)

//自定义颜色
func RGBColor(r:CGFloat,g:CGFloat,b:CGFloat) -> UIColor{
    return UIColor.init(red:r/255.0,green: g/255.0,blue: b/255.0,alpha: 1.0)
}

//字号
func customFont(font:CGFloat) -> UIFont{
    guard kScreenH <= 736 else{
        return UIFont.systemFont(ofSize: font)
    }
    guard kScreenH == 736 else {
        return UIFont.systemFont(ofSize: font - 2)
    }
    guard kScreenH >= 736 else{
        return UIFont.systemFont(ofSize: font - 4)
    }
    return UIFont.systemFont(ofSize: font)
}

func FxLog(_ message:String, function:String = #function){
    #if DEBUG
        print("message = \(message),\(function)")
    #else
    
    #endif
}
